Skip to content

[breaking] Align board list --watch and board list json output #2219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

MatteoPologruto
Copy link
Contributor

@MatteoPologruto MatteoPologruto commented Jun 20, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Code imperfection fix

What is the current behavior?

The json output of the two commands is different.

What is the new behavior?

The output of board list --watch has changed to align to board list. The changes are:

  • matching_boards replaced boards
  • address, label, protocl and others have been grouped under port
  • eventType replaced type

These are the json outputs now:

$ ./arduino-cli.exe board list --watch --format json
{
  "eventType": "add",
  "matching_boards": [
    {
      "name": "Arduino Nano RP2040 Connect",
      "fqbn": "arduino:mbed_nano:nanorp2040connect"
    }
  ],
  "port": {
    "address": "COM3",
    "label": "COM3",
    "protocol": "serial",
    "protocol_label": "Serial Port (USB)",
    "properties": {
      "pid": "0x005E",
      "serialNumber": "93B0245008567CB2",
      "vid": "0x2341"
    },
    "hardware_id": "93B0245008567CB2"
  }
}
$ ./arduino-cli.exe board list --format json
[
  {
    "matching_boards": [
      {
        "name": "Arduino Nano RP2040 Connect",
        "fqbn": "arduino:mbed_nano:nanorp2040connect"
      }
    ],
    "port": {
      "address": "COM3",
      "label": "COM3",
      "protocol": "serial",
      "protocol_label": "Serial Port (USB)",
      "properties": {
        "pid": "0x005E",
        "serialNumber": "93B0245008567CB2",
        "vid": "0x2341"
      },
      "hardware_id": "93B0245008567CB2"
    }
  }
]

Does this PR introduce a breaking change, and is titled accordingly?

Yes

@MatteoPologruto MatteoPologruto self-assigned this Jun 20, 2023
@MatteoPologruto MatteoPologruto added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jun 20, 2023
@MatteoPologruto MatteoPologruto marked this pull request as ready for review June 20, 2023 09:13
@MatteoPologruto MatteoPologruto linked an issue Jun 20, 2023 that may be closed by this pull request
3 tasks
@MatteoPologruto MatteoPologruto force-pushed the align-board-list-output branch from 97229b3 to a281b12 Compare June 20, 2023 09:16
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01 🎉

Comparison is base (ffb3d2f) 62.93% compared to head (fd164be) 62.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2219      +/-   ##
==========================================
+ Coverage   62.93%   62.95%   +0.01%     
==========================================
  Files         220      220              
  Lines       19481    19476       -5     
==========================================
  Hits        12261    12261              
+ Misses       6137     6132       -5     
  Partials     1083     1083              
Flag Coverage Δ
unit 62.95% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/cli/board/list.go 9.15% <0.00%> (+0.28%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MatteoPologruto MatteoPologruto changed the title [skip-changelog] Align board list --watch and board list json output [breaking] Align board list --watch and board list json output Jun 20, 2023
@MatteoPologruto MatteoPologruto force-pushed the align-board-list-output branch from 61ea0c5 to fd164be Compare June 21, 2023 09:02
@MatteoPologruto MatteoPologruto merged commit 9bc2afc into arduino:master Jun 21, 2023
@MatteoPologruto MatteoPologruto deleted the align-board-list-output branch June 21, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please align the JSON output of board list and board list watch
2 participants